from flask.ext.migrate import MigrateCommand, Migrate
from flask.ext.script import Manager
from info import create_app, db, models


app = create_app('develop')


# 创建迁移对象
manager = Manager(app)
# 第一个参数是Flask的实例，第二个参数是Sqlalchemy数据库实例
Migrate(app, db)
# manager是Flask-Script的实例，这条语句在flask-Script中添加一个db命令
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
